package Huihu.src.Duoxiancheng;

public class Booking {
    public static void main(String[] args) {
        Book book=new Book();
        new Thread(book,"售票员一").start();
        new Thread(book,"售票员二").start();
        new Thread(book,"售票员三").start();
    }
}

class Book implements Runnable{
    private static int ticket=0;
    @Override
    public void run() {
        while (true){
            if (ticket>100){
                break;
            }
            System.out.println(Thread.currentThread().getName()+"卖了"+ticket+++"张票");
        }
    }
}
